package com.example.zhang;

import android.util.Log;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Cutwords {
    public String TAG = "a";
    public String str;
    public String str_1;
    public String str_2;
    public void Cutwords(String words){
        str = words;
    }
    public String Cut(){
        String pt = "\\D+\\s+?";
        Pattern pattern= Pattern.compile(pt);
        Matcher matcher=pattern.matcher(str);
        while(matcher.find()){
            System.out.println(matcher.group(0));
            str_1 = matcher.group(0);
        }
        return str_1;
    }

    public String Cut_b(){
        str_2= str.replace(str_1,"");
        return str_2;
    }
}
